home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 5 Developer's Kit / vb5 dev kit.iso / dev / desaware / stgtools / reg_demo / findvaln.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-09-27  |  4.0 KB  |  128 lines

  1. VERSION 4.00
  2. Begin VB.Form FindValName 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Find Value Name"
  5.    ClientHeight    =   2535
  6.    ClientLeft      =   2760
  7.    ClientTop       =   5955
  8.    ClientWidth     =   4995
  9.    ClipControls    =   0   'False
  10.    Height          =   3000
  11.    Left            =   2670
  12.    LinkTopic       =   "Form1"
  13.    ScaleHeight     =   2535
  14.    ScaleWidth      =   4995
  15.    Top             =   5580
  16.    Width           =   5175
  17.    Begin VB.CommandButton ButtonStart 
  18.       Caption         =   "Find"
  19.       Height          =   375
  20.       Left            =   3600
  21.       TabIndex        =   8
  22.       Top             =   2040
  23.       Width           =   1215
  24.    End
  25.    Begin VB.CommandButton ButtonCancel 
  26.       Cancel          =   -1  'True
  27.       Caption         =   "Close"
  28.       Height          =   375
  29.       Left            =   2280
  30.       TabIndex        =   7
  31.       Top             =   2040
  32.       Width           =   1215
  33.    End
  34.    Begin VB.Frame Frame1 
  35.       Caption         =   "Search Area"
  36.       ClipControls    =   0   'False
  37.       Height          =   855
  38.       Left            =   120
  39.       TabIndex        =   4
  40.       Top             =   960
  41.       Width           =   4695
  42.       Begin VB.OptionButton OptRoot 
  43.          Caption         =   "Start Search at Root"
  44.          Height          =   255
  45.          Left            =   240
  46.          TabIndex        =   6
  47.          Top             =   360
  48.          Width           =   1935
  49.       End
  50.       Begin VB.OptionButton OptCurrent 
  51.          Caption         =   "Start Search at Current Key"
  52.          Height          =   255
  53.          Left            =   2280
  54.          TabIndex        =   5
  55.          Top             =   360
  56.          Value           =   -1  'True
  57.          Width           =   2295
  58.       End
  59.    End
  60.    Begin VB.CheckBox ChkWhole 
  61.       Caption         =   "Match Whole Name Only"
  62.       Height          =   375
  63.       Left            =   2640
  64.       TabIndex        =   3
  65.       Top             =   480
  66.       Width           =   2175
  67.    End
  68.    Begin VB.CheckBox ChkCase 
  69.       Caption         =   "Match Case "
  70.       Height          =   375
  71.       Left            =   480
  72.       TabIndex        =   2
  73.       Top             =   480
  74.       Width           =   1815
  75.    End
  76.    Begin VB.TextBox KeyText 
  77.       Height          =   285
  78.       Left            =   2040
  79.       TabIndex        =   1
  80.       Top             =   120
  81.       Width           =   2775
  82.    End
  83.    Begin VB.Label Label1 
  84.       BackStyle       =   0  'Transparent
  85.       Caption         =   "Value Name to Look For:"
  86.       Height          =   255
  87.       Left            =   120
  88.       TabIndex        =   0
  89.       Top             =   120
  90.       Width           =   1815
  91.    End
  92. Attribute VB_Name = "FindValName"
  93. Attribute VB_Creatable = False
  94. Attribute VB_Exposed = False
  95. Option Explicit
  96. ' Close Button.  Unloades the dialog box.
  97. Private Sub ButtonCancel_Click()
  98.     Unload FindValName
  99. End Sub
  100. ' Find Button.  Finds al the keys and values that
  101. ' match and inserts them into the Results form
  102. ' to be viewed.
  103. Private Sub ButtonStart_Click()
  104.     Dim sCase As Boolean
  105.     Dim whole As Boolean
  106.     Dim AtRoot As Boolean
  107.     Dim RetVal As Boolean
  108.     sCase = (ChkCase.Value = 1)
  109.     whole = (ChkWhole.Value = 1)
  110.     AtRoot = OptRoot.Value
  111.     FindValName.MousePointer = 11
  112.     RetVal = BaseForm.Registry1.FindFirstValueName(KeyText, sCase, whole, AtRoot)
  113.     If RetVal = False Then
  114.         MsgBox ("There are no values in this root that match.")
  115.         FindValName.MousePointer = 0
  116.         Exit Sub
  117.     End If
  118.     FindValName.MousePointer = 0
  119.     FindResults.listresults.Clear
  120.     Do
  121.         FindResults.listresults.AddItem "KEY: " & BaseForm.Registry1.FindResultKey
  122.         FindResults.listresults.AddItem "VALUE NAME: " & BaseForm.Registry1.FindResultValueName
  123.         FindResults.listresults.AddItem ""
  124.     Loop While BaseForm.Registry1.FindNextValueName() = True
  125.     FindResults.Show
  126.     Exit Sub
  127. End Sub
  128.